Accumulators are used to perform mathematical calculations on other fields. Accumulators can be used on groups of records or all records. You can accumulate numeric variables, alpha fields or calculation fields which exist on a report. For example:
Item |
Cost |
|
A |
$150.00 |
|
B |
$200.00 |
|
C |
$50.00 |
|
D |
$100.00 |
|
Total |
$500.00 |
This is the accumulator field |
As an example, accumulator fields are included in the Debtor Account Inquiry report.
Debtor Account Inquiry Report
You can double click on accumulator fields (e.g. ACC7) to view their details.
To add an accumulator field to a report:
Refer to "Edit - Add Field".
Micronet displays the Edit Accumulator screen.
|
Technical Tip You can display this screen quickly by selecting the Accumulator Tool on the Report Generator toolbar and then clicking on the report where you want the accumulator field to be added.
|
|
Field |
Value |
||||||||||||||||
|
Accumulator |
Micronet displays the next number for the accumulator field in this report, e.g. ACC9. You can change this name if required. |
||||||||||||||||
|
File |
Micronet displays the file which contains the accumulator field to be displayed. This depends on the report you are creating or editing. |
||||||||||||||||
|
Relation |
Select a relation on which the accumulator is based, i.e. the field only appears when that relation is in use. |
||||||||||||||||
|
Variable |
This is a numeric field which exists in the selected Relation. It can also be selected from the calculation fields. See this example:
The Total Cost denotes a calculation field where the Total Cost depends on Quantity, i.e. Item Cost x Quantity. |
||||||||||||||||
|
Width (Grid Units) |
Enter the length of the field on the report in grid units. This defaults to the maximum size the field can be (as pre-set in Micronet). |
||||||||||||||||
|
Decimal |
Enter the number of decimal places to be displayed. |
||||||||||||||||
|
Comma |
Select Yes if you want commas inserted to break up numbers in thousands, or No if you don't. |
||||||||||||||||
|
Bracket |
Select Yes if you want brackets inserted around negative numbers, or No if you don't. |
||||||||||||||||
|
Prefix Dollar |
Select Yes if you want this field prefixed with a $ symbol, or No if you don't. |
||||||||||||||||
|
Type |
Select the accumulator type, i.e. the calculation on which the accumulator is based. The number in brackets next to each accumulator type shows the value that would be returned based on the table at the start of this topic. Options are:
|
||||||||||||||||
|
Control Level |
Enter the control break level for the data to be displayed. For more information about control breaks, refer to "Options - Control Breaks". |
||||||||||||||||
|
Justification |
Select whether output is to be left justified, centred or right justified. |
||||||||||||||||
|
Print Logic |
Enter any condition where the field is to be displayed if the condition is valid. For example, this would be used in the invoice format where you only want the Sales Tax field to be shown if the debtor is a wholesale debtor. Therefore in the Print Logic field of the Sales Tax field on the report, you would enter: DBT_RETAIL = = 'W'. This will only print the field when the debtor is a wholesale debtor. 0 = Does not print |
||||||||||||||||
|
Accumulate if |
Enter any condition where the record should be included in the accumulator. |
||||||||||||||||
|
Zero after use |
Select Yes if you want the value to be initialised to zero after the accumulator has been displayed, or No if you don't. |
||||||||||||||||
|
Zero Break |
Select Yes if you want the value to be initialised to zero after a break point, or No if you don't. |
||||||||||||||||
|
Under Line |
Select whether you want a single or double line to be printed on the report before or after your text field, or select No for no line. |
Micronet redisplays the Report Generator screen for the selected report. If you used the Accumulator Tool to insert the accumulator field, the field displays where you clicked.
If you used menu options to insert the accumulator field, Micronet displays a rectangle which moves with the cursor.
Micronet inserts the accumulator field on the report where you clicked.